#ifndef CUSTOM_STATEFUL_ACTION_NODE_H
#define CUSTOM_STATEFUL_ACTION_NODE_H

#include <behaviortree_cpp_v3/action_node.h>
#include "task/abstract_task.h"
#include "abstract_custom_node.h"
#include "global.h"

namespace task::node
{
class CustomStatefulActionNodeData;
class CustomStatefulActionNode: public BT::StatefulActionNode, public AbstractCustomNode
{
public:
    explicit CustomStatefulActionNode(const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr<task::AbstractTask> &task);
    ~CustomStatefulActionNode() override;

    BT::NodeStatus onStart() override;

    BT::NodeStatus onRunning() override;

    BT::NodeStatus onPause() override;

    BT::NodeStatus onResume() override;

    BT::NodeStatus onCancel() override;

    void onHalted() override;

    bool onReactive() override;

    AbstractTask *getTask() override;

    std::string toString(const std::string &prefix = "") const override;


private:
    DECLARE_DATA(CustomStatefulActionNode)
};

}

#endif //CUSTOM_STATEFUL_ACTION_NODE_H
